package cn.caplike.demo.repository.temp;

import java.security.MessageDigest;

/**
 * Description:
 *
 * @author LiKe
 * @version 1.0.0
 * @date 2022-10-10 13:49
 */
@SuppressWarnings("ALL")
public class Temp {

    public static void main(String[] args) {
        // 0ec7293effaf5061f6187ee70924f671, UPDATE cjsc.user_info t SET t.password = '1f670ecf57b336b0ab5d6164cb76bd82' WHERE t.id = 55
        System.out.println(md5(String.format("%s%s%s", "cdqfxzjd001", "8pdw8dbgdsh9", "13648068363")));
        System.out.println(md5(String.format("%s%s%s", "cdqfxzjd001", "8pdw8dbgdsh9", "13880233480")));
        System.out.println(md5(String.format("%s%s%s", "admin", "8pdw8dbgdsh9", "cjkj6688123321")));
    }

    public static String md5(String text) {
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            md5.update((text).getBytes("UTF-8"));
            byte[] b = md5.digest();
            int i;
            StringBuffer buf = new StringBuffer();
            for (int offset = 0; offset < b.length; offset++) {
                i = b[offset];
                if (i < 0) {
                    i += 256;
                }
                if (i < 16) {
                    buf.append("0");
                }
                buf.append(Integer.toHexString(i));
            }
            return buf.toString();
        } catch (Exception e) {
            return "";
        }
    }
}
